<%-- 
    Document   : ModelCars
    Created on : Nov 2, 2011, 12:08:07 AM
    Author     : Mr-aUgust
--%>

<%@page pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection, DAL.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/taglib139.tld" prefix="pg" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
        <script src="../js/jqueryvalidate.js" type="text/javascript"></script>
        <script src="../js/jquery.validate.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function() {
            $("#formmodelcar").validate
                ({
                    rules:{
                        modelname:{ required: true}
                    },
                    messages: {
                        modelname:{required:"*"}   
                        }            
                });   
                
            });
        </script>
        <style type="text/css">
            #Table
            {
            border:1px solid green;
            }
            #Table, table
            {
            margin-left:auto;
            margin-right:auto;
            }
            th
            {
             border:1px solid green;
             background-color:green;
             color:white;
            }
            .td
            {
             border:1px solid green;
            }
            .font
            {
                font-family:"Times New Roman", Times, serif;
                font-size:x-large;
                font-weight:bold;
                width:150px;
                height:40px;
                margin-left:auto;
                margin-right:auto;
                color:#0707e7;
            }
        </style>
    </head>
    <body>
    
    <%
        session.removeAttribute("status");
        session.removeAttribute("statusH");
        
        ModelCarBean cb=new ModelCarBean();
        Collection cl=cb.ListModelCar();
        request.setAttribute("mc",cl);
    %>
    
    </body>
        
        <div class="font">Model Car</div>  
        <form action="../ControllerModelCar" method="post" name="formmodelcar" id="formmodelcar">      
            <table cellpadding="5" cellspacing="5">
                <tr>
                    <td> Input Model Car:</td>
                    <td style="color:red;"><input type="text" name="modelname" /></td>
                    <td><input type="submit" name="CT" value="Create" /></td>
                </tr>       
            </table>
        </form>
            <table id="Table">
                <tr>
                    <th>ModelID</th>
                    <th>Model Name</th>
                    <th>Delete</th>
                </tr>
                <c:forEach items="${mc}" var="m">
                <tr>
                    <td class="td" width="50p" >${m.modelID}</td>
                    <td class="td" width="200px" >${m.modelName}</td>
                    <td class="td" width="50px">
                        <form action="../ControllerModelCar" method="post" name="deleteMC">
                            <input type="hidden" name="modelID" value="${m.modelID}" />
                            <input type="submit" name="delete" value="Delete" />
                        </form>
                    </td>
                </tr>
                </c:forEach>
            </table>       
</html>

